{{ define "main" }}
{{ $lan := index (split .URL "/") 1 }}

<div class="mask hide"></div>
{{ $tag := .Title }}
{{ $lan := index (split .URL "/") 1 }}
<div class="tags-filter-content">
    <div class="h5-tag">
        <div class="h5-tag-header">
            <span class="filter"><img src="/img/icon-tag.svg">Tags{{ i18n "post_filter" }}</span>
            <span class="add-blog"><img src="/img/icon-author.svg"><a href="/{{$lan}}/guidance/index.html">{{ i18n "post_blog" }}</a></span>
        </div>
        <div class="h5-tag-content hide">
            <h3 class="h5-tags">Tags</h3>
            <div class="tags">
            {{ range $name, $taxonomy := .Site.Taxonomies.tags }}
            {{ if eq ($tag|urlize) ($name|urlize) }}
                <span class="tag"><a href="/{{$lan}}/" class="active">{{ $name }}</a></span>
            {{ else }}
                <span class="tag"><a href="/{{ i18n "blog_tags_url" }}/{{ $name | urlize }}/">{{ $name }}</a></span>
            {{ end }}
            {{ end }}
            </div>          
        </div>
    </div>
</div>

<div class="container">
    <div class="section">
        <div class="columns">
            <div class="column is-9">
                <div class="tile is-child box">
                    <div class="content">
        
                    {{ $paginator := .Paginate (where .Data.Pages "Type" "post") 6 }}
                    {{ range $paginator.Pages }}
                    <article class="article">
                        <div class="article_right">
                            <a href="{{ .Permalink }}"><h3 class="blog-h3">{{ .LinkTitle }}</h3></a>
                            <div class="prop-content">
                                <img src="/img/icon-date.svg">
                                <span class="article_right_date">{{ .Date.Format "2006-01-02" }}</span>
                                <img src="/img/icon-author.svg">
                                <span class="article_right_author">{{ .Params.author }}</span>
                                <img src="/img/icon-view.svg">
                                <span id="{{ .Permalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .LinkTitle }}">
                                    <i class="leancloud-visitors-count"></i>                     
                                </span>
                            </div>
                            <div class="tags">
                                <img src="/img/icon-tag.svg">
                                {{ range .Params.tags }}
                                {{ if eq $tag .}}
                                <a href="/{{$lan}}/" class="active">{{ . }}</a>
                                {{ else }}
                                <a href="/{{$lan}}/tags/{{.|urlize}}/">{{ . }}</a>
                                {{ end }}
                                {{ end }}
                            </div>
                            <a href="{{ .Permalink }}"><img class="blog-img" src="{{ .Params.img }}"></a>
                            <div class="more">
                                <p>{{ .Params.summary }}...</p><a href="{{ .Permalink }}">{{ i18n "blog_view_more" }}</a>
                            </div>
                        </div>
                    </article>
                    
                    {{ end }}
                    </div>
                </div>
            </div>
            <div class="column is-3 isPc">
                {{ partial "widget-tags.html" . }}<br>
                {{ partial "widget-recent.html" . }}<br>
                {{ partial "widget-archives.html" . }}
            </div>
        </div>
    </div>
</div>

{{ end }}
